<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>首页-内容</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/newmain/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/newmain/css/bootstrap-responsive.min.css"/>
    <link rel="stylesheet" href="/newmain/css/fullcalendar.css"/>
    <link rel="stylesheet" href="/newmain/css/matrix-style.css"/>
    <link rel="stylesheet" href="/newmain/css/matrix-media.css"/>
    <link href="/newmain/font-awesome/css/font-awesome.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/newmain/css/jquery.gritter.css"/>

    <link href="/layui/v11/css/layui.css" rel="stylesheet">
    <link href="/layui/v2.6/adminui/dist/css/admin.css" rel="stylesheet">

    <style>
        /* 飘窗的基本样式 */
        #shenyang {
            position: absolute;
            width: 300px;
            height: 100px;
            background-color: #f0f8ff;
            border: 1px solid #ccc;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            cursor: pointer;
        }

        /* 工具栏样式 */
        .toolbar {
            background-color: #1E9FFF;
            color: white;
            padding: 5px;
            text-align: right;
            font-size: 14px;
        }

        /* 关闭按钮样式 */
        .close-btn {
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
        }

        /* 表格内容样式 */
        .popup-content {
            padding: 20px;
            text-align: center;
            font-size: 20px;
        }

    </style>
</head>
<body>

<!--main-container-part-->
<div id="content">
    <!--Action boxes-->
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="quick-actions_homepage">
                            <ul class="quick-actions">
                                <li class="bg_lb"><a href="/index/anjian" target="myframe" id="ajtitle"> <i
                                        class="icon-dashboard"></i></a>
                                </li>
                                <li class="bg_lg"><a href="/index/ruku" target="myframe"> <i class="icon-signal"></i>
                                    查补入库</a></li>
                                <!--                <li class="bg_ly"><a href="/index/jian" target="myframe">-->
                                <!--                    <i class="icon-inbox"></i>-->
                                <!--                    &lt;!&ndash;<span class="label label-important" id="jajztips"></span>&ndash;&gt;-->
                                <!--                    积案进展</a>-->
                                <!--                </li>-->
                                <!--                <li class="bg_lb"><a href="/index/jiannew" target="_blank">-->
                                <!--                    <i class="icon-inbox"></i>-->
                                <!--                    &lt;!&ndash;<span class="label label-important" id="jajztips"></span>&ndash;&gt;-->
                                <!--                    积案进展(新)</a>-->
                                <!--                </li>-->

                                <!--                <li class="bg_ly"><a href="/index/jajz" target="myframe">-->
                                <!--                    <i class="icon-inbox"></i>-->
                                <!--                    &lt;!&ndash;<span class="label label-important" id="jajztips"></span>&ndash;&gt;-->
                                <!--                    积案进展</a>-->
                                <!--                </li>-->
                                <li class="bg_lb"><a href="/index/syswjcsjb" target="myframe">
                                    <i class="icon-calendar"></i>
                                    <!--<span class="label label-important" id="jajztips"></span>-->
                                    稽比析</a>
                                </li>
                                <li class="bg_ls">
                                    <!--<a href="/index/gzzx" target="myframe">-->
                                    <a href="/index/jzgzzx" target="myframe">
                                        <i class="icon-th-list"></i>
                                        工作质效
                                    </a>
                                </li>
                                <li class="bg_lo">
                                    <a href="/index/ajyj" target="myframe">
                                        <i class="icon-warning-sign"></i>
                                        案件预警
                                    </a>
                                </li>
                                <!--                <li class="bg_db">-->
                                <!--                    <a href="/index/xafx" target="myframe">-->
                                <!--                        <i class="icon-random"></i>-->
                                <!--                        选案分析-->
                                <!--                    </a>-->
                                <!--                </li>-->
                                <!--                <li class="bg_lg">-->
                                <!--                    <a href="http://72.1.165.64/szzsk/sword?ctrl=LoginCtrl_main&zsk=true" target="_blank" rel="noopener noreferrer">-->
                                <!--                        <i class="icon-table"></i>-->
                                <!--                        12306-->
                                <!--                    </a>-->
                                <!--                </li>-->
                                <li class="bg_ls">
                                    <a href="http://100.12.64.172:8888/zcfgknw/index.html" target="_blank"
                                       rel="noopener noreferrer">
                                        <i class="icon-th-list"></i>
                                        政策法规
                                    </a>
                                </li>

                                <li class="bg_dg">
                                    <a href="/index/aizs" target="myframe">
                                        <i class="icon-user"></i>
                                        <!-- 表示客服助理 -->
                                        稽查AI助手
                                    </a>
                                </li>

                                <!--                <li class="bg_lg">-->
                                <!--                    <a href="/index/zhbb" target="myframe">-->
                                <!--                        <i class="icon-table"></i>-->
                                <!--                        智慧报表-->
                                <!--                    </a>-->
                                <!--                </li>-->
                                <!--                <li class="bg_lo"><a href="/index/error405" target="myframe"> <i class="icon-th"></i>督办信息</a></li>-->
                                <!--                <li class="bg_ls"><a href="/index/error405" target="myframe"> <i class="icon-fullscreen"></i>工作质效</a>-->
                                <!--                </li>-->
                                <!--                <li class="bg_lr"><a href="/index/error405" target="myframe"> <i class="icon-th-list"></i> 纪检工作</a>-->
                                <!--                </li>-->


                            </ul>
                        </div>
                        <iframe id="myframe" name="myframe" title="myframe" th:src="@{/index/anjian}"
                                onload="this.height=myframe.document.body.scrollHeight" width="100%"
                                style="min-height:628px;border-width:0;marginheight:0px;seamless:true;"></iframe>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--首页信息飘窗-->
<div id="layerDemo" style="margin-bottom: 0; display: none">
    <div data-method="offset" data-type="rb" id="xxtxInput"
         class="layui-btn layui-btn-normal">
    </div>
</div>
<!--<div id="shenyang">-->
<!--    &lt;!&ndash; 工具栏 &ndash;&gt;-->
<!--    <div class="toolbar">-->
<!--        <span class="close-btn" id="closeWindow"> X </span>-->
<!--    </div>-->
<!--    &lt;!&ndash; 飘窗内容 &ndash;&gt;-->
<!--    <div class="popup-content">-->
<!--        <span id="shenyangOn" style="color: blue;">沈阳市税务稽查数据比</span>-->
<!--    </div>-->
<!--</div>-->
<script src="/layui/v11/layui.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/core.util.js"></script>
<script th:inline="none">
    layui.use('layer', function () {
        const $ = layui.jquery, layer = layui.layer;
        //触发事件
        const active = {
            offset: function (othis) {
                const type = othis.data('type'), text = othis.text();
                let arr = text.split("-");
                layer.open({
                    type: 1,
                    offset: type,
                    id: 'layerDemo' + type, //防止重复弹出
                    content: '<div style="padding: 10px 50px;">'
                        + '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/workrisk/riskPage11&quot;,&quot;11001&quot;,&quot;个人提醒&quot;)")" >提醒事件：' + arr[1]
                        + '条，请处理!</div>'
                        + '<br/>'
                        + '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/workrisk/controlPage11&quot;,&quot;11101&quot;,&quot;个人督办&quot;)">督办事件：' + arr[0]
                        + '条，请处理</div>'
                        + '<br/>'
                        + '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/attention/attentionCase&quot;,&quot;80101&quot;,&quot;关注案件&quot;)">关注事件：0'
                        + '条，请处理!</div>'
                        + '</div>',
                    btn: '关闭',
                    btnAlign: 'c',//按钮居中
                    shade: 0,//不显示遮罩
                    yes: function () {
                        layer.closeAll();
                    }
                });
            }
        };
        $('#layerDemo .layui-btn').on('click', function () {
            const othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

        //沈阳市税务稽查数据比
        // 获取飘窗和关闭按钮
        const shenyangDiv = document.getElementById("shenyang");
        const closeBtn = document.getElementById("closeWindow");

        // 设置运动参数
        let directionX = 1; // 水平方向
        let directionY = 1; // 垂直方向
        const speed = 1; // 每次移动的像素值
        const interval = 30; // 刷新间隔时间
        let posX = 100; // 初始水平位置
        let posY = 100; // 初始垂直位置
        let moving = true; // 控制是否运动的标志

        // 初始化位置
        // shenyangDiv.style.left = `${posX}px`;
        // shenyangDiv.style.top = `${posY}px`;

        // 开始运动
        // const moveInterval = setInterval(() => {
        //     if (moving) { // 判断是否允许运动
        //         const windowWidth = window.innerWidth;
        //         const windowHeight = window.innerHeight;
        //         const divWidth = shenyangDiv.offsetWidth;
        //         const divHeight = shenyangDiv.offsetHeight;
        //
        //         // 边界检查
        //         if (posX <= 0) directionX = 1;
        //         if (posX + divWidth >= windowWidth) directionX = -1;
        //         if (posY <= 0) directionY = 1;
        //         if (posY + divHeight >= windowHeight) directionY = -1;
        //
        //         // 更新位置
        //         posX += directionX * speed;
        //         posY += directionY * speed;
        //
        //         // 应用新位置
        //         shenyangDiv.style.left = `${posX}px`;
        //         shenyangDiv.style.top = `${posY}px`;
        //     }
        // }, interval);

        // 鼠标移入时停止运动
        // shenyangDiv.addEventListener("mouseover", function () {
        //     moving = false; // 停止运动
        // });

        // 鼠标移出时恢复运动
        // shenyangDiv.addEventListener("mouseout", function () {
        //     moving = true; // 恢复运动
        // });
        //
        // // 关闭飘窗
        // closeBtn.addEventListener("click", function () {
        //     shenyangDiv.style.display = 'none'; // 隐藏飘窗
        // });

        // // 如果需要，恢复飘窗显示可以设置为:
        // shenyangDiv.style.display = 'block';
        //
        // // 为飘窗内容绑定点击事件
        // document.getElementById('shenyangOn').onclick = function () {
        //     window.location.href = '/index/syswjcsjb'; // 跳转到目标页面
        // };

    });

    $(function () {
        CoreUtil.sendPost("/sys/getXxtx", null, function (res) {
            if (res.code === 0) {
                var list = res.data;
                var list0 = list[0]; // 提醒
                var list1 = list[1]; // 督办
                $("#xxtxInput").html(list0 + "-" + list1);
                $('#layerDemo .layui-btn').trigger("click");
            }
        });

        CoreUtil.sendPost("/attention/initTopJajzTips", null, function (res) {
            let jajztips = res.data.JAJZTIPS;
            let dataScope = res.data.dataScope;
            $("#jajztips").text(jajztips);
            if (dataScope == "jcj") {
                $("#ajtitle").html('<i class="icon-dashboard"></i>' + '本局案件');
            } else if (dataScope == "all") {
                $("#ajtitle").html('<i class="icon-dashboard"></i>' + '本市案件');
            }
        });
    })

    function skipOpen(gnurl, gnid, title) {
        if (CoreUtil.isEmpty(gnurl) || CoreUtil.isEmpty(gnid) || CoreUtil.isEmpty(title)) {
            return false;
        } else {
            var gnurlArr = gnurl.split(",");
            var gnidArr = gnid.split(",");
            var titleArr = title.split(",");
            for (var i in gnurlArr) {
                tianzhuan(gnurlArr[i], gnidArr[i], titleArr[i])
            }
        }
    }

    function tianzhuan(gnurl, gnid, title) {
        if ($(".layui-tab-title li[lay-id]").length <= 0) {
            var title = "<span>" + title + "</span>";
            active.tabAdd(gnurl, gnid, title);
        } else {
            let isData = false;
            $.each($(".layui-tab-title li[lay-id]"),
                function () {
                    if ($(this).attr("lay-id") == dataid.attr("data-id")) {
                        isData = true;
                    }
                })
            if (isData === false) {
                if (CoreUtil.isEmpty(dataid
                    .attr("data-icon"))) {
                    let title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                } else {
                    let title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    title = '<i class="layui-icon '
                        + dataid.attr("data-icon")
                        + '"></i> ' + title;
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                }
            }
        }
        active.tabChange(gnid);
    }

    //触发事件
    var active = {
        tabAdd: function (url, id, title) {
            if (url != "" && url != null && url != undefined) {
                window.parent.layui.element
                    .tabAdd(
                        'tab',
                        {
                            title: title,
                            content: '<iframe data-frameid="'
                                + id
                                + '" frameborder="0" name="content" width="100%" src="'
                                + url + '"></iframe>',
                            id: id
                        })
            }
            FrameWH();//计算框架高度
        },
        tabChange: function (id) {
            //切换到指定Tab项
            window.parent.layui.element.tabChange('tab', id); //切换到：用户管理
            $("iframe[data-frameid='" + id + "']").attr("src",
                $("iframe[data-frameid='" + id + "']").attr("src"))//切换后刷新框架
        },
        /* tabDelete : function(id) {
            element.tabDelete("tab", id);//删除
        } */
    };

    function FrameWH() {
        var h = $(window).height();
        $(window.parent.document).find("iframe").css("height", h + "px");
    }
</script>
</body>
</html>
